package com.itheima.tlias.pojo.po;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
public class InsertStudentParam {
    @NotNull
    @Length(min = 2,max = 10,message = "姓名长度必须在2-10之间")
    private String name;
    @NotNull
    @Length(min = 10,max = 10,message = "学号长度必须为10位")
    @Pattern(regexp = "[0-9a-zA-Z]{10}",message = "必须数字和字符")
    private String no;
    @NotNull
    private Integer gender;
    @NotNull
    @Length(min = 11,max = 11,message = "手机号长度必须为11位")
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号非法")
    private String phone;
    @NotNull
    @Length(min = 18,max = 18,message = "身份证长度必须为18位")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$",message = "身份证非法")
    private String idCard;
    @NotNull
    private Integer isCollege;
    @Length(min = 0,max = 100,message = "地址长度必须在0-100之间")
    private String address;
    private Integer degree;
    @Pattern(regexp = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",message = "毕业日期格式非法")
    private LocalDate graduationDate;
    private Integer clazzId;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
}
